package com.demo.entity.enums;


public enum ReservationStatusEnum {

    RESERVATION_SUCCESS(0, "预约成功"),
    RESERVATION_FINISH(1, "已完成"),
    RESERVATION_FAIL(2,"预约失效");


    private Integer status;
    private String desc;

    ReservationStatusEnum(Integer status, String desc) {
        this.status = status;
        this.desc = desc;
    }

    public static ReservationStatusEnum getByStatus(Integer status) {
        for (ReservationStatusEnum item : ReservationStatusEnum.values()) {
            if (item.getStatus().equals(status)) {
                return item;
            }
        }
        return null;
    }

    public Integer getStatus() {
        return status;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
